home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005.7z / CHIP Utilities 2005.iso / images / freesco.igz / freesco.img / router / rc / rc_crond < prev    next >
Encoding:
Text File  |  2003-02-16  |  473 b   |  31 lines

  1. #!/bin/sh
  2. #
  3. # Start/stop Dillon's cron scheduler service
  4.  
  5. . /etc/system.cfg
  6.  
  7. fn2()    { ps | sed -n '/d    cron/P'; }
  8. stp()    {
  9.     [ "`fn2`" ] || return
  10.     echo -n "Stopping crond...            "
  11.     killall crond
  12.     =
  13. }
  14. str()    {
  15.     [ "$ENACRON" = n -o "`fn2`" ] && return
  16.     echo -n "Starting crond...            "
  17.     fork crond -b -c /etc/cron
  18.     = $?
  19. }
  20.  
  21. case "$1" in
  22.  
  23.     start)    str;;
  24.     stop)    stp;;
  25.     restart)stp;str;;
  26.     status)    if [ "`fn2`" ]
  27.             then echo "Running crond"; fn2
  28.             else echo No running crond
  29.         fi;;
  30. esac
  31.